/*
 * Tower.java
 *
 * Created on November 24, 2007, 3:30 PM
 *
 * Copyright (C) 2007-2008  Hylke van der Schaaf
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, in version 3 of the License.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 */
package hextd.tower;

import hextd.hex.Hex;
import hextd.util.TowerChangeListener;
import java.awt.Graphics2D;

/**
 *
 * @author hylke
 */
public interface Tower {

	public TowerFactory.type getType();

	public int getOwner();

	public boolean isActive();

	public void doTick(int gameTime);

	public void resetScale();

	public void paint(Graphics2D g2, int gameTime);

	public void paintEffects(Graphics2D g2, int gameTime);

	public void setSelected(boolean selected);

	public String getStatusString();

	public String getInfoString();

	public PanelTowerSettings getButtons();

	public boolean canSell();

	public void queueSell(int activateTick);

	public boolean canUpgrade();

	public void queueUpgrade(int activateTick);

	public void cancelBuild();

	/**
	 * Get the price for upgrading this tower. If future, get the price to put
	 * another upgrade in the queue. If !future, then get the price to actually 
	 * do the first queued upgrade.
	 * @param future Current upgrade in the queue or a new upgrade?
	 * @return the price.
	 */
	public int getUpgradePrice(boolean future);

	public int getSellPrice();

	public float getRangeBase();

	public float getRangeCurrent();

	public void setHex(Hex hex);

	public Hex getHex();

	public int getMode(int m);

	public boolean setMode(int activateTick, int m, int v);

	/**
	 * Change per-map settings of a tower. Used when instantiating towers
	 * that are defined in a map. Shoud not be used during game as changes
	 * are not recorded.
	 * @param key the name of the setting to change
	 * @param value the value to change the setting to.
	 */
	public void setSetting(JsonTower.optionKey key, String value);

	public void registerTower(Tower t);

	public void unregisterTower(Tower t);

	public void doCleanup();

	public void addTowerChangeListener(TowerChangeListener l);

	public void removeTowerChangeListener(TowerChangeListener l);
}
